package summer.greedy;

public class Solution55 {
    public boolean canJump(int[] nums) {
        int max = 1;
        int i = 0;
        while (i < nums.length && i < max) {
            max = Math.max(max, i + nums[i] + 1);
            i++;
            if (max >= nums.length) return true;
        }
        return false;
    }
}
